<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .out{
            list-style: none;
            float: left;
            width: 80px;
            height: 50px;
            text-align: center;
            line-height: 50px;
            padding: 8px 10px;
            margin: 3px;
            border-radius: 3px;
            background-color: bisque;
            color: brown;
        }
        .over{
            background-color: brown;
            color: aliceblue;
            box-shadow: 0px 0px 10px red;
        }
    </style>
</head>
<body>
    <ul>
        <li>1</li>
        <li>2</li>
        <li>3</li>
        <li>4</li>
        <li>5</li>
    </ul>
    <script>
        //根据标签名获取页面元素 document.getElementsByTagName('标签名')
        var lis = document.getElementsByTagName('li');
        for(var i=0;i<lis.length;i++){
            lis[i].onmouseover = function(){
                this.className += ' over' ;
            }
            lis[i].onmouseout = function(){
                this.className = 'out' ;
            }
        }
    </script>
</body>
</html>